<html>
<head><meta charset="utf-8"><title>Documenting usage through Cargo · t-compiler/wg-profile-guided-optimization · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/index.html">t-compiler/wg-profile-guided-optimization</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html">Documenting usage through Cargo</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="166370490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166370490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166370490">(May 23 2019 at 15:17)</a>:</h4>
<p>Nice work on the PGO docs <span class="user-mention" data-user-id="124287">@mw</span>! One thing I was noticing and when testing out locally is that we may want to have more full docs on how to use it with Cargo?</p>



<a name="166370495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166370495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166370495">(May 23 2019 at 15:17)</a>:</h4>
<p>some questions I was left with were:</p>



<a name="166370514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166370514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166370514">(May 23 2019 at 15:17)</a>:</h4>
<p>1. You compile the instrumented binary with <code>-O</code>, right? Like <code>RUSTFLAGS=-Zpgo-gen cargo build --release</code></p>



<a name="166370587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166370587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166370587">(May 23 2019 at 15:18)</a>:</h4>
<p>2. We'll want to recommend that you use <code>--target</code> with <code>pgo-gen</code> because otherwise if you use <code>RUSTFLAGS</code> then everyone's build script will start spewing profiling data everywhere</p>



<a name="166370620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166370620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166370620">(May 23 2019 at 15:18)</a>:</h4>
<p>3. The argument of <code>-Z pgo-gen</code> may want to be documented a bit more? I found that it appeared to be the directory in which all profiling data was placed</p>



<a name="166370642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166370642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166370642">(May 23 2019 at 15:18)</a>:</h4>
<p>4. We probably also want to document smoke-test usage of <code>llvm-profdata</code></p>



<a name="166370667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166370667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166370667">(May 23 2019 at 15:19)</a>:</h4>
<p>5. I think we will want to recommend <code>rustup component add llvm-tools-preview</code> to get the <code>llvm-profdata</code> binary (and how to execute it)</p>



<a name="166370697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166370697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166370697">(May 23 2019 at 15:19)</a>:</h4>
<p>6. What's the use case of multiple <code>*.profraw</code> files? Is the idea that each execution of a binary generates one such file, and then they're all merged into one?</p>



<a name="166370706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166370706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166370706">(May 23 2019 at 15:19)</a>:</h4>
<p>7. We support this on all tier 1 platforms, right? (aka windows/mac/linux)</p>



<a name="166370816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166370816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166370816">(May 23 2019 at 15:20)</a>:</h4>
<p>I also didn't really know how to get confirmation that PGO data was succesfully used, but I was also PGO'ing Cargo itself which is typically I/O bound rather than CPU bound so I wasn't entirely surprised about that</p>



<a name="166370826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166370826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166370826">(May 23 2019 at 15:20)</a>:</h4>
<p>just a minor thing!</p>



<a name="166437642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166437642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166437642">(May 24 2019 at 09:49)</a>:</h4>
<p>so, I was planning on adding documentation to the <a href="https://doc.rust-lang.org/stable/rustc/" target="_blank" title="https://doc.rust-lang.org/stable/rustc/">rustc book</a></p>



<a name="166437651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166437651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166437651">(May 24 2019 at 09:49)</a>:</h4>
<p>but that's pretty specific to rustc</p>



<a name="166437724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166437724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166437724">(May 24 2019 at 09:50)</a>:</h4>
<p>I agree that it would make sense to document how to use this with Cargo</p>



<a name="166437737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166437737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166437737">(May 24 2019 at 09:50)</a>:</h4>
<p>do you have a suggestion on where to put that?</p>



<a name="166437762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166437762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166437762">(May 24 2019 at 09:51)</a>:</h4>
<p>the <a href="https://doc.rust-lang.org/cargo/" target="_blank" title="https://doc.rust-lang.org/cargo/">cargo book</a> maybe?</p>



<a name="166438088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166438088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166438088">(May 24 2019 at 09:56)</a>:</h4>
<blockquote>
<p>6. What's the use case of multiple <code>*.profraw</code> files? Is the idea that each execution of a binary generates one such file, and then they're all merged into one?</p>
</blockquote>
<p>Each binary and each shared library create their own <code>.profraw</code> file, so you might get multiple <code>profraw</code> files from a single program invocation.</p>



<a name="166438127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166438127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166438127">(May 24 2019 at 09:57)</a>:</h4>
<p>otoh, if I understand things correctly, multiple invocations of the same program will keep updating the same <code>profraw</code> files.</p>



<a name="166438451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166438451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166438451">(May 24 2019 at 10:02)</a>:</h4>
<blockquote>
<p>2. We'll want to recommend that you use <code>--target</code> with <code>pgo-gen</code> because otherwise if you use <code>RUSTFLAGS</code> then everyone's build script will start spewing profiling data everywhere</p>
</blockquote>
<p>Can you tell me more about that? How does this work exactly?</p>



<a name="166458958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166458958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166458958">(May 24 2019 at 14:41)</a>:</h4>
<p><span class="user-mention" data-user-id="116015">@Alex Crichton</span> this is something I also just come across with <code>-Zself-profile</code> where I also don't want the flag to be added for build scripts.</p>



<a name="166459634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166459634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166459634">(May 24 2019 at 14:49)</a>:</h4>
<p><span class="user-mention" data-user-id="124287">@mw</span> eh I don't mind too much where this goes, I just figure it should go somewhere :)</p>



<a name="166459640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166459640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166459640">(May 24 2019 at 14:49)</a>:</h4>
<p>so this is where Cargo is a bit wonky</p>



<a name="166459661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166459661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166459661">(May 24 2019 at 14:50)</a>:</h4>
<p>but if you pass <code>--target $YOUR_HOST</code> it's actually different than not passing <code>--target</code></p>



<a name="166459714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166459714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166459714">(May 24 2019 at 14:50)</a>:</h4>
<p>even though it produces the same binary</p>



<a name="166459720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166459720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166459720">(May 24 2019 at 14:50)</a>:</h4>
<p>it triggers effectively cross compilation logic in Cargo</p>



<a name="166459734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166459734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166459734">(May 24 2019 at 14:50)</a>:</h4>
<p>so <code>RUSTFLAGS</code> is only passed to the target, not the target + host</p>



<a name="166460193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166460193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166460193">(May 24 2019 at 14:56)</a>:</h4>
<p>I wanna write "makes sense", but ... <code>:P</code></p>



<a name="166460210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166460210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166460210">(May 24 2019 at 14:56)</a>:</h4>
<p>a very interesting piece of information though</p>



<a name="166460220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166460220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166460220">(May 24 2019 at 14:56)</a>:</h4>
<p>I did not know that</p>



<a name="166460643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166460643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166460643">(May 24 2019 at 15:01)</a>:</h4>
<p>rest assured you're not the only person who's been tripped up by it</p>



<a name="166646396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166646396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166646396">(May 27 2019 at 15:37)</a>:</h4>
<p><span class="user-mention" data-user-id="116015">@Alex Crichton</span> <code>rustup component add llvm-tools-preview</code> seems to install <code>llvm-profdata</code> in a kind of obscure path. For example <code>~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin</code>.</p>



<a name="166646405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166646405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166646405">(May 27 2019 at 15:38)</a>:</h4>
<p>Is there a way to call the tool ergonomically?</p>



<a name="166646461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166646461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166646461">(May 27 2019 at 15:38)</a>:</h4>
<p><code>rustup which</code> does not seem to work</p>



<a name="166646511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166646511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166646511">(May 27 2019 at 15:39)</a>:</h4>
<p><code>rustup run nightly llvm-profdata</code> seems work</p>



<a name="166646610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166646610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166646610">(May 27 2019 at 15:40)</a>:</h4>
<p>would be great if <code>rustup run</code> could just the default toolchain for a given path</p>



<a name="166646723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166646723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166646723">(May 27 2019 at 15:42)</a>:</h4>
<p>oh, it does <em>not</em> work. It calls whatever is on <code>PATH</code></p>



<a name="166715544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166715544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166715544">(May 28 2019 at 13:19)</a>:</h4>
<p>Yeah we've never really "stabilized" this in one form or another</p>



<a name="166715628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166715628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166715628">(May 28 2019 at 13:20)</a>:</h4>
<p>currently the tools were added mostly for the embedded WG where the idea is that there's otherwise existing tooling which reaches into the sysroot to use these executables</p>



<a name="166715654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166715654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166715654">(May 28 2019 at 13:20)</a>:</h4>
<p>we have historically not wanted to commit to the stability of their location or availability</p>



<a name="166715693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166715693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166715693">(May 28 2019 at 13:21)</a>:</h4>
<p>in that sense it's intentional that they're not the easiest to use, but that's sort of the same for PGO in that it's not really the easiest to use so it may just want to be documented where to find them</p>



<a name="166715889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166715889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166715889">(May 28 2019 at 13:22)</a>:</h4>
<p>OK</p>



<a name="166715941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166715941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166715941">(May 28 2019 at 13:23)</a>:</h4>
<p>I also found out that all versions of <code>llvm-profdata</code> since LLVM 3.9 seem to work just fine what rustc is currently producing</p>



<a name="166716077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166716077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166716077">(May 28 2019 at 13:24)</a>:</h4>
<p>so I'm just going to recommend using <code>llvm-profdata</code> from "a recent LLVM installation" as a fallback</p>



<a name="166720814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166720814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166720814">(May 28 2019 at 14:13)</a>:</h4>
<p><span class="user-mention" data-user-id="124287">@mw</span> sounds good, it sounds like they've probably put effort into stabilizing it themselves maybe?</p>



<a name="166721114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting%20usage%20through%20Cargo/near/166721114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/187830-t-compiler/wg-profile-guided-optimization/topic/Documenting.20usage.20through.20Cargo.html#166721114">(May 28 2019 at 14:16)</a>:</h4>
<p>maybe. At least I think they are trying to only change it with good reason</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>